package svc

import (
	"github.com/zeromicro/go-zero/core/stores/sqlx"
	"label/internal/config"
	"label/mysql"
)

type ServiceContext struct {
	Config     config.Config
	Conn       sqlx.SqlConn
	LabelModel mysql.LabelModel
}

func NewServiceContext(c config.Config) *ServiceContext {
	conn := sqlx.NewMysql(c.MySQL.DataSource)
	return &ServiceContext{
		Config:     c,
		Conn:       conn,
		LabelModel: mysql.NewLabelModel(conn),
	}
}
